<?php
require_once('MainModel.php');

/**
 * Add your description here
 *
 * @author Anh euro
 * @copyright Hipt Group
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */
 
class Vina_Model_Products extends MainModel
{

    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Id;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_CategoryId;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Name;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameEn;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_NameChina;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Price;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Weight;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Madein;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Image;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Description;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_DescriptionEn;
    
    /**
     * mysql var type varchar(500)
     *
     * @var string     
     */
    protected $_DescriptionChina;
    
    /**
     * mysql var type text
     *
     * @var text     
     */
    protected $_Content;
    
    /**
     * mysql var type text
     *
     * @var text     
     */
    protected $_ContentEn;
    
    /**
     * mysql var type text
     *
     * @var text     
     */
    protected $_ContentChina;
    
    /**
     * mysql var type tinyint(1)
     *
     * @var int     
     */
    protected $_IsBest;
    
    /**
     * mysql var type tinyint(1)
     *
     * @var int     
     */
    protected $_IsSale;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Created;
    
    /**
     * mysql var type tinyint(1)
     *
     * @var int     
     */
    protected $_Status;
    

    

function __construct() {
    $this->setColumnsList(array(
    'id'=>'Id',
    'category_id'=>'CategoryId',
    'name'=>'Name',
    'name_en'=>'NameEn',
    'name_china'=>'NameChina',
    'price'=>'Price',
    'weight'=>'Weight',
    'madein'=>'Madein',
    'image'=>'Image',
    'description'=>'Description',
    'description_en'=>'DescriptionEn',
    'description_china'=>'DescriptionChina',
    'content'=>'Content',
    'content_en'=>'ContentEn',
    'content_china'=>'ContentChina',
    'is_best'=>'IsBest',
    'is_sale'=>'IsSale',
    'created'=>'Created',
    'status'=>'Status',
    ));
}

	
    
    /**
     * sets column id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setId($data)
    {
        $this->_Id=$data;
        return $this;
    }

    /**
     * gets column id type int(11)
     * @return int     
     */
     
    public function getId()
    {
        return $this->_Id;
    }
    
    /**
     * sets column category_id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setCategoryId($data)
    {
        $this->_CategoryId=$data;
        return $this;
    }

    /**
     * gets column category_id type int(11)
     * @return int     
     */
     
    public function getCategoryId()
    {
        return $this->_CategoryId;
    }
    
    /**
     * sets column name type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setName($data)
    {
        $this->_Name=$data;
        return $this;
    }

    /**
     * gets column name type varchar(255)
     * @return string     
     */
     
    public function getName()
    {
        return $this->_Name;
    }
    
    /**
     * sets column name_en type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setNameEn($data)
    {
        $this->_NameEn=$data;
        return $this;
    }

    /**
     * gets column name_en type varchar(255)
     * @return string     
     */
     
    public function getNameEn()
    {
        return $this->_NameEn;
    }
    
    /**
     * sets column name_china type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setNameChina($data)
    {
        $this->_NameChina=$data;
        return $this;
    }

    /**
     * gets column name_china type varchar(255)
     * @return string     
     */
     
    public function getNameChina()
    {
        return $this->_NameChina;
    }
    
    /**
     * sets column price type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setPrice($data)
    {
        $this->_Price=$data;
        return $this;
    }

    /**
     * gets column price type varchar(255)
     * @return string     
     */
     
    public function getPrice()
    {
        return $this->_Price;
    }
    
    /**
     * sets column weight type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setWeight($data)
    {
        $this->_Weight=$data;
        return $this;
    }

    /**
     * gets column weight type varchar(255)
     * @return string     
     */
     
    public function getWeight()
    {
        return $this->_Weight;
    }
    
    /**
     * sets column madein type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setMadein($data)
    {
        $this->_Madein=$data;
        return $this;
    }

    /**
     * gets column madein type varchar(255)
     * @return string     
     */
     
    public function getMadein()
    {
        return $this->_Madein;
    }
    
    /**
     * sets column image type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setImage($data)
    {
        $this->_Image=$data;
        return $this;
    }

    /**
     * gets column image type varchar(255)
     * @return string     
     */
     
    public function getImage()
    {
        return $this->_Image;
    }
    
    /**
     * sets column description type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setDescription($data)
    {
        $this->_Description=$data;
        return $this;
    }

    /**
     * gets column description type varchar(255)
     * @return string     
     */
     
    public function getDescription()
    {
        return $this->_Description;
    }
    
    /**
     * sets column description_en type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setDescriptionEn($data)
    {
        $this->_DescriptionEn=$data;
        return $this;
    }

    /**
     * gets column description_en type varchar(255)
     * @return string     
     */
     
    public function getDescriptionEn()
    {
        return $this->_DescriptionEn;
    }
    
    /**
     * sets column description_china type varchar(500)     
     *
     * @param string $data
     * @return Vina_Model_Products     
     *
     **/

    public function setDescriptionChina($data)
    {
        $this->_DescriptionChina=$data;
        return $this;
    }

    /**
     * gets column description_china type varchar(500)
     * @return string     
     */
     
    public function getDescriptionChina()
    {
        return $this->_DescriptionChina;
    }
    
    /**
     * sets column content type text     
     *
     * @param text $data
     * @return Vina_Model_Products     
     *
     **/

    public function setContent($data)
    {
        $this->_Content=$data;
        return $this;
    }

    /**
     * gets column content type text
     * @return text     
     */
     
    public function getContent()
    {
        return $this->_Content;
    }
    
    /**
     * sets column content_en type text     
     *
     * @param text $data
     * @return Vina_Model_Products     
     *
     **/

    public function setContentEn($data)
    {
        $this->_ContentEn=$data;
        return $this;
    }

    /**
     * gets column content_en type text
     * @return text     
     */
     
    public function getContentEn()
    {
        return $this->_ContentEn;
    }
    
    /**
     * sets column content_china type text     
     *
     * @param text $data
     * @return Vina_Model_Products     
     *
     **/

    public function setContentChina($data)
    {
        $this->_ContentChina=$data;
        return $this;
    }

    /**
     * gets column content_china type text
     * @return text     
     */
     
    public function getContentChina()
    {
        return $this->_ContentChina;
    }
    
    /**
     * sets column is_best type tinyint(1)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setIsBest($data)
    {
        $this->_IsBest=$data;
        return $this;
    }

    /**
     * gets column is_best type tinyint(1)
     * @return int     
     */
     
    public function getIsBest()
    {
        return $this->_IsBest;
    }
    
    /**
     * sets column is_sale type tinyint(1)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setIsSale($data)
    {
        $this->_IsSale=$data;
        return $this;
    }

    /**
     * gets column is_sale type tinyint(1)
     * @return int     
     */
     
    public function getIsSale()
    {
        return $this->_IsSale;
    }
    
    /**
     * sets column created type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setCreated($data)
    {
        $this->_Created=$data;
        return $this;
    }

    /**
     * gets column created type int(11)
     * @return int     
     */
     
    public function getCreated()
    {
        return $this->_Created;
    }
    
    /**
     * sets column status type tinyint(1)     
     *
     * @param int $data
     * @return Vina_Model_Products     
     *
     **/

    public function setStatus($data)
    {
        $this->_Status=$data;
        return $this;
    }

    /**
     * gets column status type tinyint(1)
     * @return int     
     */
     
    public function getStatus()
    {
        return $this->_Status;
    }
    
    /**
     * returns the mapper class
     *
     * @return Vina_Model_ProductsMapper
     *
     */

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Vina_Model_ProductsMapper());
        }
        return $this->_mapper;
    }


    /**
     * deletes current row by deleting a row that matches the primary key
     * 
     * @return int
     */

    public function deleteRowByPrimaryKey()
    {
        if (!$this->getId())
            throw new Exception('Primary Key does not contain a value');
        return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());
    }

}

